package com.Register.mapper;

import com.Register.entity.VolunteerActivity;
import com.Register.es.ActivityDoc;
import com.Register.vo.MyActivityPageQueryVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface VolunteerActivityMapper extends BaseMapper<VolunteerActivity> {
    // 查询用户报名的所有活动，返回分页结果
    List<MyActivityPageQueryVO> getActivitiesByUserId(@Param("userId") Long userId, @Param("offset") Long offset, @Param("limit") Long limit,@Param("status") Integer status);


    @Select("select activity_name from volunteer_activity where id =#{id}")
    String getActivityNameById(@Param("id") Long id);

    @Select("select id,activity_name,organization,recruit_number,tag,begin_time,end_time from volunteer_activity limit #{pageNum},#{pageSize}")
    Page<ActivityDoc> getActivityDocPage(@Param("pageNum") int pageNum, @Param("pageSize") int pageSize);
}
